<template>
	<view>
		<view class="content">
			<view class="list">
				<view class="row" @click="toVerifyPhone()">
					<view class="title">修改手机号码</view>
					<view class="right"><view class="tis">{{user.userPhone}}</view><view class="icon xiangyou"></view></view>
				</view>
				<view class="row" @click="toVerifyPassword()">
					<view class="title">修改密码</view>
					<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
				</view>
			</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{
				},
			};
		},
		onLoad() {
			this.isLogin();
			this.getUserMessage();
		},
		onShow() {
			this.isLogin();
			this.showUserMessage();
		},
		onPullDownRefresh() {
		    setTimeout(function () {
		        uni.stopPullDownRefresh();
		    }, 1000);
		},
		methods: {
			getUserMessage(){
				this.$req.getUserPersonalInformation().then(res=>{
					this.user = res;
				})
			},
			showUserMessage(){
				try {
						let user = uni.getStorageSync('user');
						if(user){
							this.user = user;
						}
				} catch (e) {
				    this.$utils.msg("连接网络错误，请检查网络是否连接！");
				}
			},
			isLogin(){
					try {
						let token = uni.getStorageSync('token');
					if (!token) {
				       uni.reLaunch({
				       	    url: '../../login/login'
				       	});
				    }
				} catch (e) {
				    this.$utils.msg("连接网络错误，请检查网络是否连接！");
				}
			},
			toVerifyPhone(){
					uni.navigateTo({
						url:'./verifyPhone'
					})
			},
			toVerifyPassword(){
					uni.navigateTo({
						url:'./verifyPassword'
					})
			},
		}
	}
</script>

<style lang="scss">
page{
	background-color: #f3f3f3;	
}

.icon {
	font-size: 30upx;

}
.content{
	padding-bottom: 20upx;
	.list{
		width: 96%;
		padding-left: 4%;
		background-color: #fff;
		margin-bottom: 20upx;
		.row{
			widows: 100%;
			min-height: 90upx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: solid 1upx #eee;
			&:last-child{
				border-bottom: none;
			}
			.title{
				font-size: 32upx;
				color: #333;
			}
			.right{
				display: flex;
				align-items: center;
				color: #999;
				.tis{
					font-size: 26upx;
					margin-right: 5upx;
					max-height: 120upx;
					image{
						width: 100upx;
						height: 100upx;
						border-radius: 100%;
						margin: 10upx 0;
					}
				}
				.icon{
					width: 40upx;
					color: #cecece;
				}
			}
			
		}
	}
}

</style>
